home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / tbbs / prgsourc.zip / HOMES.ZIP / MAKE.PRG < prev    next >
Text File  |  1996-01-09  |  7KB  |  215 lines

  1. DO cls WITH 0,0,23,79
  2. file = "C:\HOMEBASE\TEXT\homebase.txt"
  3.  
  4. FCREATE fil (file) 13 0 2048
  5. IF fil < 0
  6.    SET COLOR TO W+/N
  7.    ecode = Ferror()
  8.    @ 20,5 SAY "Error creating file: " + Message(ecode)
  9.    key = InKey(5)
  10.    ok = .F.
  11.    RETURN
  12. ENDIF
  13. FLWRITE fil rite "                    HomeBase, The Real Estate Database" + Chr(13) + Chr(10)
  14.  
  15. SELECT a
  16. SET ORDER TO 2
  17.  
  18. y = 1
  19. DO WHILE .T.
  20.    SEEK tarray[y]
  21.    IF tarray[y] = "EMPTY"
  22.       EXIT
  23.    ENDIF
  24.    FLWRITE fil rite Chr(13) 
  25.    FLWRITE fil rite "Listing #" + homes + pic1 + Chr(13) 
  26.    IF rite < 1       
  27.       FCLOSE fil
  28.       ok = .F.
  29.       RETURN
  30.    ENDIF
  31.    x = 1
  32.    DO WHILE x < 7
  33.       DO CASE
  34.          CASE x = 1
  35.               line = "Price: $" + LJust(Str(price)) +  "             " + sub + Chr(13) 
  36.          CASE x = 2
  37.               line = RTrim(exterior) + " " + RTrim(design) + Chr(13) 
  38.          CASE x = 3     
  39.               line = Str(size) + " sq. feet" + Chr(13)
  40.          CASE x = 4
  41.               line = "Lot Size: " + Ltrim(Str(acres)) + " acres" + Chr(13)  
  42.          CASE x = 5
  43.               line = "Bedrooms: " + Ltrim(Str(beds)) + Chr(13)  
  44.          CASE x = 6            
  45.               line = "Bathrooms: " + Ltrim(Str(baths)) + Chr(13) 
  46.       
  47.       ENDCASE
  48.       x = x + 1
  49.       FLWRITE fil rite line
  50.       IF rite < 1
  51.          FCLOSE fil
  52.          ok = .F.
  53.          RETURN
  54.       ENDIF
  55.    ENDDO
  56.    IF garage
  57.       IF basement
  58.          IF ac
  59.             IF heatpump
  60.                IF heat # "Heat Pump"
  61.                   line = "Features: garage, basement, central air, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  62.                ELSE
  63.                   line = "Features: garage, basement, central air, Heat Pump" + Chr(13)
  64.                ENDIF
  65.             ELSE
  66.                line = "Features: garage, basement, central air, " + Rtrim(heat) + " heat" + Chr(13)
  67.             ENDIF
  68.          ELSE
  69.             IF heatpump
  70.                IF heat # "Heat Pump"
  71.                   line = "Features: garage, basement, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  72.                ELSE
  73.                   line = "Features: garage, basement, Heat Pump" + Chr(13)
  74.                ENDIF
  75.             ELSE
  76.                line = "Features: garage, basement, " + Rtrim(heat) + " heat" + Chr(13)
  77.             ENDIF
  78.          ENDIF
  79.       ELSE
  80.          IF ac
  81.             IF heatpump
  82.                IF heat # "Heat Pump"
  83.                   line = "Features: garage, central air, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  84.                ELSE   
  85.                   line = "Features: garage, central air, Heat Pump" + Chr(13)
  86.                ENDIF
  87.             ELSE
  88.                line = "Features: garage, central air, " + Rtrim(heat) + " heat" + Chr(13)
  89.             ENDIF
  90.          ELSE
  91.             IF heatpump
  92.                IF heat # "Heat Pump"
  93.                   line = "Features: garage, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  94.                ELSE
  95.                   line = "Features: garage, Heat Pump" + Chr(13)
  96.                ENDIF
  97.             ELSE
  98.                line = "Features: garage, " + Rtrim(heat) + " heat" + Chr(13)
  99.             ENDIF
  100.          ENDIF
  101.       ENDIF
  102.    ELSE
  103.       IF basement
  104.          IF ac
  105.             IF heatpump
  106.                IF heat # "Heat Pump"
  107.                   line = "Features: basement, central air, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  108.                ELSE
  109.                   line = "Features: basement, central air, Heat Pump" + Chr(13)
  110.                ENDIF
  111.             ELSE
  112.                line = "Features: basement, central air, " + Rtrim(heat) + " heat" + Chr(13)
  113.             ENDIF
  114.          ELSE
  115.             IF heatpump
  116.                IF heat # "Heat Pump"
  117.                   line = "Features: basement, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  118.                ELSE
  119.                   line = "Features: basement, Heat Pump" + Chr(13)
  120.                ENDIF
  121.             ELSE
  122.                line = "Features: basement, " + Rtrim(heat) + " heat" + Chr(13)
  123.             ENDIF
  124.          ENDIF
  125.       ELSE
  126.          IF ac
  127.             IF heatpump
  128.                IF heat # "Heat Pump"
  129.                   line = "Features: central air, Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  130.                ELSE
  131.                   line = "Features: central air, Heat Pump" + Chr(13)
  132.                ENDIF
  133.             ELSE
  134.                line = "Features: central air, " + Rtrim(heat) + " heat" + Chr(13)
  135.             ENDIF
  136.          ELSE
  137.             IF heatpump
  138.                IF heat # "Heat Pump"
  139.                   line = "Heat: Heat Pump, " + Rtrim(heat) + " backup" + Chr(13)
  140.                ELSE
  141.                   line = "Heat: Heat Pump" + Chr(13)
  142.                ENDIF
  143.             ELSE
  144.                line = "Heat:  " + Rtrim(heat) + Chr(13)
  145.             ENDIF
  146.          ENDIF
  147.       ENDIF
  148.    ENDIF
  149.    FLWRITE fil rite line
  150.    IF rite < 1
  151.       FCLOSE fil
  152.       ok = .F.
  153.       RETURN
  154.    ENDIF
  155.    IF fireplace # 0
  156.       IF fireplace = 1
  157.          line = "           and fireplace" + Chr(13)
  158.       ELSE
  159.          line = "           and " + Ltrim(Str(fireplace)) + " fireplaces" + Chr(13)
  160.       ENDIF
  161.    ELSE
  162.       line = Chr(13)
  163.    ENDIF
  164.    FLWRITE fil rite line
  165.    IF rite < 1
  166.       FCLOSE fil
  167.       ok = .F.
  168.       RETURN
  169.    ENDIF
  170.    FLWRITE fil rite Chr(13)
  171.    FLWRITE fil rite memo1 + Chr(13)
  172.    FLWRITE fil rite memo2 + Chr(13)
  173.    FLWRITE fil rite memo3 + Chr(13) + Chr(13)
  174.    IF rite < 1
  175.       FCLOSE fil
  176.       ok = .F.
  177.       RETURN
  178.    ENDIF
  179.    SELECT c
  180.    SEEK a->broker
  181.    IF Found()
  182.       FLWRITE fil rite "Listing Agent: " + Rtrim(uname) + "         " + homeph + Chr(13)
  183.       FLWRITE fil rite "Agency: " + agency + "       " + phone1 + Chr(13)
  184.       FLWRITE fil rite "        " + address + phone2 + Chr(13) + Chr(13)
  185.       FLWRITE fil rite "        " + city + Chr(13) + Chr(13)
  186.       IF rite < 1
  187.          FCLOSE fil
  188.          ok = .F.
  189.          RETURN
  190.       ENDIF
  191.    ENDIF
  192.    SELECT a
  193.    SET COLOR TO W+/N
  194.    IF y<22
  195.       @ y,5 SAY "Listing" + LTrim(Str(y)) + "created"
  196.    ELSE
  197.       @ y-21,5 SAY "Listing" + LTrim(Str(y)) + "created"
  198.    ENDIF
  199.    key = inkey(1)
  200.    y = y + 1
  201. ENDDO
  202. FLWRITE fil rite Chr(13) + Chr(13) 
  203. FLWRITE fil rite "              LocalNet BBS, Powhatan, Virginia" + Chr(13)
  204. FLWRITE fil rite "                     BBS: (804) 598-2817" + Chr(13)
  205. FLWRITE fil rite "                    Voice: (804) 598-2687" + Chr(13)
  206. IF rite < 1
  207.    FCLOSE fil
  208.    ok = .F.
  209.    RETURN
  210. ENDIF
  211.  
  212. FCLOSE fil
  213. ok = .T.
  214. RETURN
  215.